fix: satisfy clippy::useless_borrows_in_formatting (unbreaks CI)#370
Conversation
Rust 1.97 added useless_borrows_in_formatting, which fires on two existing sites. CI installs stable and runs clippy with -D warnings, so main goes red on the next run through no change of its own. Drop the redundant references. No behaviour change - Display and Debug are implemented for both the value and the reference.
ReviewSmall, well-scoped fix — verified both hunks against current Correctness
Both match exactly what Code quality / style: Diff is minimal and idiomatic — this is the correct fix rather than suppressing the lint with an Scope: I swept the rest of Tests / CI: No test coverage needed — this is a non-behavioral lint fix. The PR description documents reproduction against a pinned 1.97 toolchain ( Security: None applicable — no user input, no I/O behavior change. No issues found. LGTM — this should merge quickly since (per the PR description) it's blocking green CI for other open PRs. |
CI on
mainis broken, and every open PR is red because of it — including a docs-only one. This is the fix.Cause
The
Testworkflow installsstableand runscargo clippy -- -D warnings. Stable has since moved to Rust 1.97, which addeduseless_borrows_in_formatting. It fires on two pre-existing sites:src/server/mod.rs:179—println!("...{:?}", &state.base_path)src/util/cooklang_to_cooklang.rs:118—&igr.nameas aformat!argumentNothing changed in the repo.
main's last green run was 1 July; the toolchain moved underneath it. Clippy's failure is the first step in the job, so builds and tests never even run — which is why #367, #368 and #369 all reportTest faildespite passing locally.Change
Drop the two redundant references. No behaviour change:
Display/Debugare implemented for both the value and the reference, so the formatted output is identical.Verification
Reproduced the failure on
mainwith a pinned 1.97 toolchain, then confirmed the fix against the same toolchain CI uses:cargo +1.97 clippy --all-targets -- -D warnings— 0 issues (default and--no-default-features)cargo +1.97 fmt --check— cleancargo +1.97 test— 13 suites passWorth merging first — the other PRs cannot show green until this lands.